<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>删除无效</title>
</head>

<body>
    <script>
        var arr = ['有效', '无效', '有效', '无效', '无效', '有效'];
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] == '无效') {
                arr.splice(i, 1);
                i--;
            }
        }
        console.log(arr);

        var b, a = [4]; b = a; a = [4, 44]; document.write(b+'<br>'); a = b;document.write(a+'<br>'); b.push(44); document.write(a);
        var arr1=[1,[2,3]];
        var arr2=[arr1[0],arr1[1]];
        arr1.push(4);
        arr1.shift();
        console.log(arr2);
        document.write(arr2);
    </script>
</body>

</html>